package com.zxq.kingofbots.controller.user.account;

import com.zxq.kingofbots.service.user.account.TokenService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
public class TokenController {
    @Autowired
    private TokenService tokenService;

    @PostMapping("/user/account/token")
    public Map<String,String> getToken(@RequestParam Map<String,String> map){
        String username=map.get("username");
        String password=map.get("password");
//        System.out.println(username);
        return tokenService.getToken(username,password);
    }
}
